#include "funrecognize.h"
#include "ui_funrecognize.h"

FunRecognize::FunRecognize(QWidget *parent) :
    QWidget(parent),
    ui(new Ui::FunRecognize)
{
    ui->setupUi(this);
    this->pSmilecatch = new SmileCatch;
    this->pGenderage = new GenderAge;

    connect(ui->back,&QPushButton::clicked,[=](){
        emit this->back();
    });

    connect(this->pSmilecatch,&SmileCatch::back,[=](){
        this->pSmilecatch->hide();
        this->show();
    });
    connect(this->pGenderage,&GenderAge::back,[=](){
        this->pGenderage->hide();
        this->show();
    });
}

FunRecognize::~FunRecognize()
{
    delete ui;
}

void FunRecognize::on_smile_clicked()
{
    this->hide();
    this->pSmilecatch->show();
}

void FunRecognize::on_gender_age_clicked()
{
    this->hide();
    this->pGenderage->show();
}

void FunRecognize::on_exit_clicked()
{
    exit(0);
}
